<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>BiwaScheme</title>
    <link href="/website/css/screen.css" rel="stylesheet" type="text/css">
    <link href="/website/css/jquery.terminal-2.3.0.css" rel="stylesheet" type="text/css"></script>
    <link href="/website/css/prism-coy.css" rel="stylesheet" type="text/css"></script>
    <script src="/release/biwascheme-@VERSION@-min.js" type="text/javascript"></script>
    <script src="/website/js/jquery.mousewheel.min.js" type="text/javascript"></script>
    <script src="/website/js/jquery.timers.min.js" type="text/javascript"></script>
    <script src="/website/js/jquery.cookie.min.js" type="text/javascript"></script>
    <script src="/website/js/jquery.terminal-2.3.0.js" type="text/javascript"></script>
    <script src="/website/js/prism.js" type="text/javascript"></script>
    <script src="/website/js/prism-scheme.js" type="text/javascript"></script>
    <script src="/website/js/jquery.terminal.prism.js" type="text/javascript"></script>
    <script src="/website/js/keyboard.js" type="text/javascript"></script>
    <script src="/website/js/biwascheme_terminal.js" type="text/javascript"></script>
  </head>
  <body>
    <a href="https://github.com/biwascheme/biwascheme"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a>

    <div id="menu">
      <a href="/index.html">
        <img src="/website/images/biwascheme_logo.png" alt="logo"
             title="BiwaScheme logo by @jcubic">
      </a>
      <ul>
        <li><a href='/doc/features.html'>Features</a></li>
        <li><a href='/doc/getting_started.html'>Getting Started</a></li>
        <li><a href='/doc/reference.html'>Reference</a></li>
        <li><a href='/doc/faq.html'>FAQ</a></li>
        <li><a href='/doc/index.html'>Other docs</a></li>
      </ul>
    </div>
    <div id="content">
<h1 id="biwascheme-reading-guide">BiwaScheme Reading Guide</h1>
<p>This is a brief guide for reading the source code of BiwaScheme.</p>
<h2 id="directory-organization">Directory organization</h2>
<ul>
<li>bin/<ul>
<li>biwas : Entry point of the <code>biwas</code> command (installed by <code>npm install biwascheme -g</code>)</li>
</ul>
</li>
<li>release/<ul>
<li>biwascheme.js : Generated by <code>make</code> command</li>
</ul>
</li>
<li>src/<ul>
<li>deps/ : Contains dependent JavaScript libraries (such as underscore.js)</li>
<li>library/ : Library functions</li>
<li>platforms/ : Code only runs on a certain platform (browser or Node)</li>
<li>system/ : Main source code of BiwaScheme</li>
<li>development_initializer.js</li>
<li>header.js</li>
<li>version.js</li>
<li>version.js.in</li>
</ul>
</li>
<li>test/<ul>
<li>unit.js : Unit test</li>
<li>spec.html : Runs unit test</li>
</ul>
</li>
</ul>
<p>Some of the most important files are:</p>
<ul>
<li>src/library/r6rs_lib.js <ul>
<li>Contains most of the library functions</li>
</ul>
</li>
<li>src/system/parser.js<ul>
<li><code>BiwaScheme.Parser</code> parses Scheme program (given as JavaScript String)</li>
</ul>
</li>
<li>src/system/compiler.js<ul>
<li><code>BiwaScheme.Compiler</code> compiles parsed program into BiwaScheme intermediate language</li>
</ul>
</li>
<li>src/system/interpreter.js<ul>
<li><code>BiwaScheme.Interpreter</code> executes the intermediate lanugage</li>
</ul>
</li>
</ul>
<h2 id="the-intermediate-language">The intermediate language</h2>
<p>See <a href="opecodes.html">internal/opecodes</a>.</p>
    </div>

    <!-- Google Analytics -->
    <script>
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

      ga('create', 'UA-2023947-5', 'auto');
      ga('send', 'pageview');
    </script>
  </body>
</html>
